<template>
  <div
    id="userLayout"
    :class="['user-layout-wrapper', isMobile && 'mobile']"
  >
    <div class="container">
      <div class="bg">
        <img src="~@/assets/login-bg.png" alt="">
      </div>
      <div class="login">
        <!-- <div class="login-title">
          <div class="header">
              <img
                src="~@/assets/logo.svg"
                class="logo"
                alt="logo"
              >
            <span class="title">{{config.title}}登录</span>
          </div>
          <div class="desc">
            第1.0版
          </div>
        </div> -->

        <div class="login-main">
          <div class="login-sub">
            <img src="~@/assets/login-bg.png" alt="">
          </div>

          <div class="login-from">
            <router-view />
          </div>
        </div>
        
      </div>

      <div class="footer">
        <!-- <div class="links">
          <a href="_self">帮助</a>
          <a href="_self">隐私</a>
          <a href="_self">条款</a>
        </div> -->
        <div class="copyright">
          Copyright &copy; 2021 - {{ new Date().getFullYear() }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import { deviceMixin } from '@/store/device-mixin'
import config from '@/config/defaultSettings'
export default {
  name: 'UserLayout',
  // mixins: [deviceMixin],
  mounted () {
    document.body.classList.add('userLayout')
  },
  computed: {
    config() {
      return config
    }
  },
  beforeDestroy () {
    document.body.classList.remove('userLayout')
  }
}
</script>

<style lang="less" scoped>
#userLayout.user-layout-wrapper {
  height: 100%;

  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
        background: #fff;
      }
    }
  }

  .login {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border-radius: 10px;
    // transform: translateY(-100px);
  }

  .login-main {
    width: 1000px;
    height: 574px;
    display: flex;
    position: absolute;
    // right: 200px;
    left: 50%;
    top: 50%;
    border-radius: 10px;
    overflow: hidden;
    transform: translate(-50%, -50%);
    box-shadow: 0px 0px 5px #005f10;
    border: 4px solid  rgba(255, 255, 255, .5);
  }

  .login-from {
    width: 420px;
    height: 100%;
    flex: 1;
    // border-radius: 10px;
  }

  .login-sub {
    flex: 1;
    width: 100%;
    height: auto;
    overflow: hidden;
    img {
      width: 100vw;
      position: relative;
      top: calc((570px - 100vh) / 2);
      left: calc((1000px - 100vw) / 2);
      z-index: -1;
    }
  }

  .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    // background: url(~@/assets/login-bg.png) no-repeat center;
    // background-filter: blur(5px);
    // background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
    background-size: 100%;
    // padding: 110px 0 144px;
    position: relative;

    .bg {
      width: 100%;
      height: 100%;
      position: absolute;
      left: 0;
      top: 0;
      overflow: hidden;
      img {
        width: 100%;
        filter: blur(2px) saturate(70%);
      }
    }

    a {
      text-decoration: none;
    }

    .login-title {
      text-align: center;
      // background: linear-gradient(126deg, #f2ffee99, #44912b99);
      color: #fff;
      width: 520px;
      margin-bottom: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      .header {

        .badge {
          position: absolute;
          display: inline-block;
          line-height: 1;
          vertical-align: middle;
          margin-left: -12px;
          margin-top: -10px;
          opacity: 0.8;
        }

        .logo {
          height: 44px;
          vertical-align: top;
          margin-right: 16px;
          border-style: none;
        }

        .title {
          font-size: 40px;
          font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
          font-weight: 600;
          position: relative;
          color: @primary-color;
          // -webkit-text-fill-color: #ffdaa6;/*文字的填充色*/
          -webkit-text-stroke: 1px #fff;
          top: 2px;
        }
      }
      .desc {
        font-size: 20px;
        color: rgba(0, 0, 0, 0.45);
        margin-top: 12px;
        margin-bottom: 40px;
      }
    }

    .main {
      // min-width: 260px;
      width: 500px;
      // height: 400px;
      overflow: hidden;
      // margin: 0 auto;
      background-color: rgba(255, 255, 255, 0.9);
      padding: 100px 80px;
      
      // border-radius: 10px;
      box-sizing: border-box;
      // /deep/ .ant-form-item {
      //   margin-bottom: auto;
      // }
      // display: flex;
      // align-items: center;
      /deep/ h1 {
        color: #333;
        font-size: 30px;
        margin-bottom: 30px;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: bold;
        span {
          color: #666;
          font-size: 20px;
          margin-left: 20px;
          font-weight: normal;
        }
      }

      // /deep/ input {
      //   background-color: #eee;
      // }

    }

    .footer {
      position: absolute;
      width: 100%;
      bottom: 0;
      padding: 0 16px;
      margin: 48px 0 24px;
      text-align: center;

      .links {
        margin-bottom: 8px;
        font-size: 14px;
        a {
          color: rgba(0, 0, 0, 0.45);
          transition: all 0.3s;
          &:not(:last-child) {
            margin-right: 40px;
          }
        }
      }
      .copyright {
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
      }
    }
  }
}
</style>
